package com.foreknow.oopTest;

import java.awt.*;

/**
 * @author shkstart
 * @create 2021-07-23 13:31
 */
public class Point {
    private int x;
    private int y;

    public Point() {
    }

    public Point(int x0, int y0) {
        this.x = x0;
        this.y = y0;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    /**
     * 移动位置
     * @param dx 横坐标
     * @param dy 纵坐标
     */
    public void movePoint(int dx,int dy){
        this.setX(dx);
        this.setY(dy);
    }
    public static void main(String[] args) {
        Point p1=new Point(1,2);
        p1.movePoint(8,8);
        System.out.println(p1.getX()+"-------"+p1.getY());
        Point p2=new Point(3,4);
        p2.movePoint(9,9);
        System.out.println(p2.getX()+"--------"+p2.getY());
    }
}
